<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>输出图象到浏览器或文件。</title>
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-base.css" />
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-medium.css" />

 </head>
 <body class="docs"><div class="navbar navbar-fixed-top">
  <div class="navbar-inner clearfix">
    <ul class="nav" style="width: 100%">
      <li style="float: left;"><a href="function.imagearc.html">« imagearc</a></li>
      <li style="float: right;"><a href="function.imagebmp.html">imagebmp »</a></li>
    </ul>
  </div>
</div>
<div id="breadcrumbs" class="clearfix">
  <ul class="breadcrumbs-container">
    <li><a href="index.html">PHP Manual</a></li>
    <li><a href="ref.image.html">GD 和图像处理 函数</a></li>
    <li>输出图象到浏览器或文件。</li>
  </ul>
</div>
<div id="layout">
  <div id="layout-content"><div id="function.imageavif" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">imageavif</h1>
  <p class="verinfo">(PHP 8 &gt;= 8.1.0)</p><p class="refpurpose"><span class="refname">imageavif</span> &mdash; <span class="dc-title">输出图象到浏览器或文件。</span></p>

 </div>
 
 <div class="refsect1 description" id="refsect1-function.imageavif-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>imageavif</strong></span>(<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type"><a href="class.gdimage.html" class="type GdImage">GdImage</a></span> <code class="parameter">$image</code></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type"><span class="type">resource</span>|<span class="type">string</span>|<span class="type">null</span></span> <code class="parameter">$file</code><span class="initializer"> = <strong><code>null</code></strong></span></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type">int</span> <code class="parameter">$quality</code><span class="initializer"> = -1</span></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type">int</span> <code class="parameter">$speed</code><span class="initializer"> = -1</span></span><br>): <span class="type">bool</span></div>

  
  <p class="para rdfs-comment">
   Outputs or saves a <abbr>AVIF</abbr> Raster image from the given <code class="parameter">image</code>.
  </p>
 </div>

 <div class="refsect1 parameters" id="refsect1-function.imageavif-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>
    <dt>

<code class="parameter">image</code></dt>
<dd>
<p class="para">由图象创建函数(例如<span class="function"><a href="function.imagecreatetruecolor.html" class="function">imagecreatetruecolor()</a></span>)返回的 
<span class="classname"><a href="class.gdimage.html" class="classname">GdImage</a></span> 对象。</p></dd>

    
     <dt>
<code class="parameter">file</code></dt>

     <dd>

      <p class="para">
       文件保存的路径或者已打开的流资源（此方法返回后自动关闭该流资源），如果未设置或为 <strong><code>null</code></strong>，将会直接输出原始图象流。
      </p>
     </dd>

    
    
     <dt>
<code class="parameter">quality</code></dt>

     <dd>

      <p class="para">
       <code class="parameter">quality</code> is optional, and ranges from 0 (worst quality, smaller file)
       to 100 (best quality, larger file).
       If <code class="literal">-1</code> is provided, the default value <code class="literal">30</code> is used.
      </p>
     </dd>

    
    
     <dt>
<code class="parameter">speed</code></dt>

     <dd>

      <p class="para">
       <code class="parameter">speed</code> is optional, and ranges from 0 (slow, smaller file)
       to 10 (fast, larger file).
       If <code class="literal">-1</code> is provided, the default value <code class="literal">6</code> is used.
      </p>
     </dd>

    
   </dl>

  </p>
 </div>

 <div class="refsect1 returnvalues" id="refsect1-function.imageavif-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   成功时返回 <strong><code>true</code></strong>， 或者在失败时返回 <strong><code>false</code></strong>。
  </p>
  <div class="caution"><strong class="caution">警告</strong><p class="simpara">如果 libgd 输出图像失败，函数会返回 <strong><code>true</code></strong>。</p></div>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.imageavif-seealso">
  <h3 class="title">参见</h3>
  <ul class="simplelist">
   <li class="member"><span class="function"><a href="function.imagepng.html" class="function" rel="rdfs-seeAlso">imagepng()</a> - 以 PNG 格式将图像输出到浏览器或文件</span></li>
   <li class="member"><span class="function"><a href="function.imagewbmp.html" class="function" rel="rdfs-seeAlso">imagewbmp()</a> - 输出图象到浏览器或文件。</span></li>
   <li class="member"><span class="function"><a href="function.imagejpeg.html" class="function" rel="rdfs-seeAlso">imagejpeg()</a> - 输出图象到浏览器或文件。</span></li>
   <li class="member"><span class="function"><a href="function.imagetypes.html" class="function" rel="rdfs-seeAlso">imagetypes()</a> - 返回 PHP 内置支持的图像类型</span></li>
  </ul>
 </div>

</div></div></div></body></html>